import VueI18n from 'vue-i18n'
import Vue from 'vue'
import elementZh from 'element-ui/lib/locale/lang/zh-CN'
import elementEn from 'element-ui/lib/locale/lang/en'
import cookieJS from 'js-cookie'

Vue.use(VueI18n)

const i18n = new VueI18n({
  locale: cookieJS.get('lang') || 'zh',
  messages: {
    en: {
      home: 'home',
      ...elementEn
    },
    zh: {
      home: '首页',
      ...elementZh
    }
  }
})
export default i18n
